
# 导包
import time
import unittest

import app
from scripts.test01_login import Test_Login

from scripts.test02_staff import Test_Staff

from tools.HTMLTestRunner import HTMLTestRunner
import sys
sys.path.append('C:\\Users\\HUAWEI\\Desktop\\python\\IHRM')

# 封装测试套件

suite = unittest.TestSuite()
suite.addTest(unittest.makeSuite(Test_Login))
suite.addTest(unittest.makeSuite(Test_Staff))


# 指定报告路径
report = app.base_dir+"/report/report-{}.html".format(time.strftime("%Y%m%d-%H%M%S"))

# 打开文件流
with open(report, "wb") as f:
    # 创建HTMLTestRunner运行器
    runner = HTMLTestRunner(f, title="tpshop接口测试报告")
    # 执行测试套件
    runner.run(suite)
    f.close()